import React, { Component } from 'react'

export default class Tab extends Component {
  render() {
    const { list, activeId, changFatherState } = this.props
    console.log(list, 'list tab')
    return (
      <div>
        <ul className="tabBar">
          {list.map((item, index) => {
            return (
              <li
                key={item.id}
                className={item.id === activeId ? 'active' : ''}
                onClick={() => changFatherState(item.id)}>
                {item.title}
              </li>
            )
          })}
        </ul>
      </div>
    )
  }
}
